
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!<html lang="en"> <![endif]-->

<!-- BEGIN HEAD -->

<html lang="en"> 
    <head>

        <?php $this->renderPartial('//layouts/includes/head'); ?>

    </head>

    <body>

        <header class="grey"> <!-- Header start -->
            <a href="#" class="logo_image"><span class="hidden-480">MeetClic</span></a>
            <ul class="header_actions pull-left hidden-480 hidden-768">
                <li rel="tooltip" data-placement="bottom" title="Ocultar/Mostrar Menu" ><a href="#" class="hide_navigation"><i class="icon-chevron-left"></i></a></li>

            </ul>
            <ul class="header_actions">

                <li rel="tooltip" data-placement="bottom" title="2 new messages" class="hidden-480 messages"><a class="iconic" href="#"><i class="icon-envelope-alt"></i> 2</a>
                    <ul class="dropdown-menu pull-right messages_dropdown">
                        <li>
                            <a href="#">
                                <img src="demo/avatar_06.png" alt="">
                                <div class="details">
                                    <div class="name">Jane Doe</div>
                                    <div class="message">
                                        Lorem ipsum Commodo quis nisi...
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a href="#">
                                <img src="demo/avatar_05.png" alt="">
                                <div class="details">
                                    <div class="name">Jane Doe</div>
                                    <div class="message">
                                        Lorem ipsum Commodo quis nisi...
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a href="#">
                                <img src="demo/avatar_04.png" alt="">
                                <div class="details">
                                    <div class="name">Jane Doe</div>
                                    <div class="message">
                                        Lorem ipsum Commodo quis nisi...
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a href="#">
                                <img src="demo/avatar_05.png" alt="">
                                <div class="details">
                                    <div class="name">Jane Doe</div>
                                    <div class="message">
                                        Lorem ipsum Commodo quis nisi...
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a href="#">
                                <img src="demo/avatar_06.png" alt="">
                                <div class="details">
                                    <div class="name">Jane Doe</div>
                                    <div class="message">
                                        Lorem ipsum Commodo quis nisi...
                                    </div>
                                </div>
                            </a>
                        </li>
                        <a href="#" class="btn btn-block blue align_left"><span>Messages center</span></a>
                    </ul>
                </li>

                <li class="dropdown">
                    <a href="#">
                        <img src="<?php echo Yii::app()->theme->baseUrl; ?>/demo/avatar_06.png" alt="User image" class="avatar">
                        <span class="username"><?php echo Yii::app()->user->name ? Yii::app()->user->name : "Welcome" ?></span><i class="icon-angle-down"></i>
                    </a>
                    <ul>
                        <?php if (!Yii::app()->user->isGuest): ?>
                            <li><?php echo CHtml::link('<i class="icon-user"></i>&nbsp;&nbsp;Mi Cuenta', array('/cruge/ui/editprofile')) ?></a></li>
                            <?php if (Yii::app()->user->checkAccess('admin')): ?>
                                <li><?php echo CHtml::link('<i class="icon-cog"></i>&nbsp;&nbsp;Administración', Yii::app()->user->ui->userManagementAdminUrl) ?></li>
                            <?php endif; ?>
                            <li><?php echo CHtml::link('<i class="icon-key"></i>&nbsp;&nbsp;Cerrar Sesión', Yii::app()->user->ui->logoutUrl) ?></a></li>
                        <?php else: ?>
                            <li><?php echo CHtml::link('<i class="icon-key"></i>&nbsp;&nbsp;Iniciar Sesión', Yii::app()->user->ui->loginUrl) ?></a></li>
                        <?php endif; ?>
                    </ul>
                </li>
            </ul>
        </header>



        <div id="main_navigation" class="blue"> <!-- Main navigation start -->
            <div class="inner_navigation">
                <?php
//                var_dump($this->admin);

                $this->widget('zii.widgets.CMenu', array(
                    'items' => $this->admin ? Menu::getAdminMenu($this) : Menu::getMenu($this),
                    'encodeLabel' => false,
                    'itemCssClass' => 'sub-menu',
                    'activeCssClass' => 'active',
                    'htmlOptions' => array('class' => 'main'), //clase principal
                    'submenuHtmlOptions' => array('class' => 'sub_main')//submenus hijos
                ));
//if()
                if (Yii::app()->user->isGuest) {
                    $this->widget('zii.widgets.CMenu', array(
                        'items' => array(
                            array('label' => '<i class="icon-briefcase"></i> Empresas', 'url' => array('/crm/cuenta/admin'), 'access' => 'action_cuenta_admin', 'active_rules' => array('module' => 'crm', 'controller' => 'cuenta'))),
                        'encodeLabel' => false,
                        'itemCssClass' => 'sub-menu',
                        'activeCssClass' => 'active',
                        'htmlOptions' => array('class' => 'main'), //clase principal
                        'submenuHtmlOptions' => array('class' => 'sub_main')//submenus hijos
                    ));
                }
                ?>

            </div>
        </div>  

        <div id="content" style="padding-top: 45px;"> <!-- Content start -->
            <!--<div id="content" style="padding-top: 45px;">  Content start -->
            <div class="top_bar">
                <ul class="breadcrumb">
                    <li><a href="dashboard.html"><i class="icon-home"></i></a> <span class="divider">/</span></li>
                    <li class="active"><a href="#">UI</a></li>
                </ul>
            </div>

            <div class="inner_content">
                <div class="row-fluid">
                    <div id="maiMessages" class="flash-messages">
                        <?php
                        $messages = Yii::app()->user->getFlashes();
                        if ($messages) {
                            foreach ($messages as $key => $message) {
                                echo '<div class="alert alert-' . $key . '">'
                                . '<button data-dismiss="alert" class="close" type="button">×</button>'
                                . $message . "</div>\n";
                            }
                        }
                        ?>
                    </div>
                </div>



                <div class="widgets_area">
                    <?php echo $content; ?>
                </div>
            </div>
            <!--</div>-->
        </div>


        <footer>
            <span class="hidden-480">  <?php echo date('Y') ?> © Meet Click</span>
            <ul>
                <li><a href="#">Quienes Somos</a></li>
                <li><a href="#">Conctactanos</a></li>
                <li><a href="#">Registrate</a></li>
            </ul>
        </footer>


        <!-- MAIN MODAL -->
        <div class="row-fluid">
            <?php
// El modal de la página
            $this->beginWidget('bootstrap.widgets.TbModal', array('id' => 'mainModal', 'options' => array('backdrop' => 'static')));
            $this->endWidget();
            ?>
        </div>

        <?php $this->renderPartial('//layouts/includes/foot'); ?>



    </body>
    <!-- END BODY -->
</html>